<template>
  <div class="cardItem">
    <div class="left">
      <div class="empty" v-if="isStart"></div>
      <div :class="['line_start', isTopLineFinish ? 'lineFinished' : 'lineNoFinished']" v-else></div>
      <div :class="['circle', isCircleFinish ? 'circleFinished' : 'circleNoFinished']">
        <span v-if="circleTip !== '√'">{{ circleTip }}</span>

        <img class="imgIcon" src="~/static/images/career_synthesize_icon_complete.png" alt v-else />
      </div>
      <div
        :class="['line_bottom', isBottomLineFinish ? 'lineFinished' : 'lineNoFinished']"
        v-if="!isEnd"
      ></div>
    </div>
    <div class="right">
      <span class="title">{{ rightTitle }}</span>
      <button
        :class="['btn', hasWrite ? 'btn_again' : 'btn_start']"
        @click="btnClick(hasWrite, nextStep-1)"
      >{{ hasWrite ? '重评' : '开始'}}</button>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    isEnd: Boolean,
    rightTitle: String,
    hasWrite: String,
    isCircleFinish: String,
    circleTip: String,
    isTopLineFinish: Boolean,
    isBottomLineFinish: Boolean,
    nextStep: Number,
    finishStep: Number,
    isStart: Boolean,
    orderNum: Number
  },
  components: {},
  data() {
    return {};
  },
  methods: {
    btnClick(type, num) {
      // console.log("num: ", num);
      // console.log("type: ", type);
      if (num < 5) {
        this.commonJs.gopush("advantageBySelf", num);
      } else {
        this.commonJs.gopush("ConventionTopics", num);
      }
      // if(this.orderNum){
      //
      //   return false;
      // }
      console.log(type, num);

      // this.commonJs.gopush('ConventionTopics',num)
    }
  }
};
</script>

<style lang="less" scoped>
.cardItem {
  background: #fff;
  display: flex;
  justify-content: space-between;
  padding: 0 0.3rem;
  .left {
    .circle {
      width: 0.6rem;
      height: 0.6rem;
      line-height: 0.6rem;
      text-align: center;
      border-radius: 50%;
      font-weight: bold;
      font-size: 0.28rem;
    }
    .circleFinished {
      background: @mainColor;
      color: #fff;
      box-shadow: 0 0.06rem 0.16rem 0 rgba(137, 205, 79, 0.3);
      padding-top: 0.05rem;
      .imgIcon {
        width: 0.3rem;
        height: 0.3rem;
      }
    }
    .circleNoFinished {
      border: 0.08rem solid rgba(238, 238, 238, 1);
      color: @mainColor;
      line-height: 0.45rem;
    }
    .line_bottom {
      width: 0.1rem;
      height: 0.63rem;
      margin: 0 auto;
    }
    .empty {
      width: 0.1rem;
      height: 0.35rem;
    }
    .line_start {
      width: 0.1rem;
      height: 0.35rem;
      margin: 0 auto;
    }
    .lineNoFinished {
      background: #eeeeee;
    }
    .lineFinished {
      background: #eeeeee;
    }
  }
  .right {
    width: 6.1rem;
    height: 1.2rem;
    box-shadow: 0px 0px 20px 0px rgba(204, 204, 204, 0.3);
    border-radius: 10px;
    padding: 0 0.3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .title {
      font-weight: bold;
      color: #222;
      font-size: 0.34rem;
    }
    .btn {
      width: 1.58rem;
      height: 0.6rem;
      line-height: 0.6rem;
      border-radius: 0.1rem;
      text-align: center;
      font-size: 0.26rem;
      font-weight: bold;
      box-sizing: border-box;
      outline: none;
    }
    .btn_again {
      border: 1px solid @mainColor;
      color: @mainColor;
      background: #fff;
    }
    .btn_start {
      color: #fff;
      background: @mainColor;
      border: none;
    }
  }
}
.paddingTop {
  padding-top: 0.5rem;
}
</style>

